/********************************************************************************************/
/*                                              README                                      */
/********************************************************************************************/
/*This script will execute all of the UNDO scripts required                                 */
/*to bring your database up to date to the current                                          */
/*release of the UTILITYDB code.                                                            */	
/********************************************************************************************/
/*Things to Do:                                                                             */
/********************************************************************************************/
/*1.) Run in SQLCMD Mode (QUERY MENU->SQLCMD Mode)                                          */
/*2.) Set the SCRIPTFOLDER to the location of your script folder                            */
/*3.) Make sure you are in the correct database                                             */
/*4.) If you want to create a UtilityDB Database uncomment UtilityDB_V1R0001.sql section    */
/********************************************************************************************/
SET XACT_ABORT ON;
print suser_name()
print db_name()
print @@serverName
print @@serviceName
print @@version
print @@timeticks
print getdate()

/********************************************************/
/* Please set the SQL Path to the location of the script*/
/********************************************************/
:setvar sqlPath1 "SCRIPTFOLDER\My Documents\SQL Server Management Studio\Projects\UtilityDB\Version_02dot0\" 
:setvar sqlPath1 "C:\Users\sfibich\Documents\SQL Server Management Studio\UtilityDB\Version_02dot0\"

/**********************/
/*Output file location*/
/**********************/
--:Out $(sqlPath1)"Output.txt"


print ''
print '------------------------Release:2----------------------------'
print ':r $(sqlPath1)"Undo_UtilityDB_V2R00003.sql"';
:r $(sqlPath1)Undo_UtilityDB_V2R00003.sql
go
print ':r $(sqlPath1)"Undo_UtilityDB_V2R00002.sql"';
:r $(sqlPath1)Undo_UtilityDB_V2R00002.sql
go
print ':r $(sqlPath1)"Undo_UtilityDB_V2R00001.sql"';
:r $(sqlPath1)Undo_UtilityDB_V2R00001.sql
go
print '------------------------Release:1----------------------------'
print ':r $(sqlPath1)"Undo_UtilityDB_V1R00003.sql"';
:r $(sqlPath1)Undo_UtilityDB_V1R00003.sql
go
print ':r $(sqlPath1)"UtilityDB_V1R00002.sql"';
:r $(sqlPath1)Undo_UtilityDB_V1R00002.sql
go
print ':r $(sqlPath1)"Undo_UtilityDB_V1R00001.sql"';
:r $(sqlPath1)Undo_UtilityDB_V1R00001.sql
go

